<template>
  <el-carousel :interval="5000" arrow="always">
    <el-carousel-item v-for="(item,key) in swiperArr" :key="key">
        <ul  class="news">
            <li @click="fn(val.url)" v-for="(val,key) in item" :key="key"><span></span><strong>{{val.companyName}}</strong><b>HOT!</b></li>
        </ul>
    </el-carousel-item>
  </el-carousel>
</template>

<script>
export default {
  data(){
    return{
      datas:[],
      swiperArr:[]
    }
  },
  methods:{
    fn(key){
      window.location.href=key
    }
  },
  created: async function(){
  let {data} =await this.$http.get("/loginapi/getlunbo")
  //  console.log( data.Data)
   let res1 = data.Data.splice(0,6);
   let res2 = data.Data.splice(0,6);
   let res3 = data.Data.splice(0,6);
   let arr = [];
   arr.push(res1);
   arr.push(res2);
   arr.push(res3)
    this.swiperArr = arr;
    this.datas=data
  } 
}
</script>
<style scoped>

/deep/.el-carousel__container{
    height: 4.2rem;
   position: relative;
    margin-bottom: .2rem;
}
/deep/.el-carousel__button{
    height: .2rem;
    width: .2rem;
    border-radius: 50%;
}
/deep/.el-carousel__button{
    background-color: orange;;
}
 .el-carousel__item h3 {
    color: #475669;
    font-size: .18rem;
    opacity: 0.75;
    /* line-height: 300px; */
    margin: 0;
  }
.news{
    width: 80%;
    height: 80%;
    font-size: .28rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}
.news>li{
    margin-bottom: .15rem;
    list-style:none;
    display: flex;
    justify-content: start;
    align-items: center;
    
}
.news>li>strong{
    width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: underline;
}
.news>li>span{
    display: block;
    width: .1rem;
    height: .1rem;
    margin-right: .1rem;
    background-color: #ff4c58;
    border-radius: 50%;
}
.news>li>b{
    display: block;
    width: .2rem;
    width: .2rem;
    color: #ff4c58;
}
  .el-carousel__item:nth-child(2n) {
    background-color: white;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: white;
  }
</style>